#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

version := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2)
targetdir := debian/tmp/usr/src/exfat-$(version)

%:
	dh $@ --with dkms

override_dh_auto_install:
	mkdir -p $(targetdir)
	install -m644 *.c *.h Kconfig LICENSE Makefile $(targetdir)
	# create a Kbuild file instead of patching the Makefile
	$(MAKE) KERNELRELEASE=1 KBUILD_PATH=$(targetdir)/Kbuild -s -f Makefile -f debian/local/print_rule.mk writeKbuild

override_dh_dkms:
	dh_dkms -V $(version)

override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:
override_dh_auto_clean:
